// pages/confirmOrder/confirmOrder.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    totalMoney: "",
    goodsList: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let orderData = JSON.parse(options.orderDataStr);
    // console.log(orderData);
    this.setData({
      totalMoney: orderData.totalMoney,
      goodsList: orderData.goodsList
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  // 提交订单
  submitOrder() {
    let url = "/order/add";
    let data = {
      totalMoney: this.data.totalMoney,
      goodsList: this.data.goodsList,
    }
    app.$http.post(url, data, true).then(res => {
      console.log("提交订单", res);
    })
  }
})